/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.com.minam.beans;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alvaro
 */
@Entity
@Table(name = "TDISTRITOS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tdistritos.findAll", query = "SELECT t FROM Tdistritos t"),
    @NamedQuery(name = "Tdistritos.findByCodiDepaDpt", query = "SELECT t FROM Tdistritos t WHERE t.tdistritosPK.codiDepaDpt = :codiDepaDpt"),
    @NamedQuery(name = "Tdistritos.findByCodiProvTpr", query = "SELECT t FROM Tdistritos t WHERE t.tdistritosPK.codiProvTpr = :codiProvTpr"),
    @NamedQuery(name = "Tdistritos.findByCodiDistTdi", query = "SELECT t FROM Tdistritos t WHERE t.tdistritosPK.codiDistTdi = :codiDistTdi"),
    @NamedQuery(name = "Tdistritos.findByNombDistTdi", query = "SELECT t FROM Tdistritos t WHERE t.nombDistTdi = :nombDistTdi")})
public class Tdistritos implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TdistritosPK tdistritosPK;
    @Size(max = 50)
    @Column(name = "NOMB_DIST_TDI")
    private String nombDistTdi;

    public Tdistritos() {
    }

    public Tdistritos(TdistritosPK tdistritosPK) {
        this.tdistritosPK = tdistritosPK;
    }

    public Tdistritos(String codiDepaDpt, String codiProvTpr, String codiDistTdi) {
        this.tdistritosPK = new TdistritosPK(codiDepaDpt, codiProvTpr, codiDistTdi);
    }

    public TdistritosPK getTdistritosPK() {
        return tdistritosPK;
    }

    public void setTdistritosPK(TdistritosPK tdistritosPK) {
        this.tdistritosPK = tdistritosPK;
    }

    public String getNombDistTdi() {
        return nombDistTdi;
    }

    public void setNombDistTdi(String nombDistTdi) {
        this.nombDistTdi = nombDistTdi;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tdistritosPK != null ? tdistritosPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tdistritos)) {
            return false;
        }
        Tdistritos other = (Tdistritos) object;
        if ((this.tdistritosPK == null && other.tdistritosPK != null) || (this.tdistritosPK != null && !this.tdistritosPK.equals(other.tdistritosPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.com.minam.beans.Tdistritos[ tdistritosPK=" + tdistritosPK + " ]";
    }
    
}
